package cn.com.qtgl.apis.builtin.comp;

import cn.melonlib.apis.support.annos.AppendTenant;
import cn.melonlib.apis.support.annos.IgnoreAppend;
import cn.melonlib.cores.aop.anno.AppendAccessToken;
import cn.melonlib.cores.aop.anno.IgnorePrepend;
import cn.melonlib.cores.aop.anno.PrependUrl;
import cn.melonlib.cores.aop.enums.AccessTokenType;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Getter
@Component
@PrependUrl
@AppendAccessToken(type = AccessTokenType.SYSTEM)
//@AppendTenant
public class IntrospectConfig {

    public static final String CONFIG_NAME="introspectConfig";
    @Value("${sso.oauth_introspect_url:/sso/oauth2/introspect}")
    private String introspect;

//    private final String name="INTROSPECT";


    public String getUrl() {
        return introspect;
    }

    @IgnoreAppend
    @IgnorePrepend
    public String getName() {
        return "INTROSPECT";
    }

    @IgnoreAppend
    @IgnorePrepend
    public AccessTokenType accessTokenType() {
        return AccessTokenType.USER;
    }
}
